<html lang="pt-br">
    <head>
        <meta http-equiv="content-type" content="text/html; charset=uft-8" />
        <?php 
			include_once ('header.php');
			include_once ('models/Veiculo.php');
			
			$v = new Veiculo;		
		?>
    </head>
    <body>
        <div class="conteudo">		
	
        	<a href="veicForm.php?id=0">
				<div class="botao add">
					<h1>Novo</h1>
				</div>
			</a>
			<br><br><br>
			<div>
				<table>
					<tr>
						<th>Marca</th>
						<th>Modelo</th>
						<th>Ano</th>
						<th>Chassi</th>
						<th>Placa</th>
					</tr>					
					
				<?php 
					foreach($v->getList() as $l){	
						echo '<tr>';
						echo '	<td>'.$l->getMarca()->getNome().'</td>';
						echo '	<td>'.$l->getModelo().'</td>';
						echo '	<td>'.$l->getAno().'</td>';
						echo '	<td>'.$l->getChassi().'</td>';
						echo '	<td>'.$l->getPlaca().'</td>';
						echo '	<td><a href="veicForm.php?id='.$l->getID().'"><img src="imagens/ico/note_edit.png" title="Editar o registro"></a></td>';						
						echo '	<td><a href="veicView.php?id='.$l->getID().'"><img src="imagens/ico/note_view.png" title="Visualizar registro"></a></td>';
						echo '	<td><a href="veicForm.php?&id='.$l->getID().'"><img src="imagens/ico/garbage_empty.png" title="Excluir registro"></a></td>';
						echo '</tr>';
					}
				?>						
				</table>
			</div>	                
        </div>    
    </body>
</html>